<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs">
<head>
<title>遵从性</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../common/favicon.ico">
<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-css:7:15cea3ec788a65b5187d4018eed543bf */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"c/language/conformance","wgTitle":"c/language/conformance","wgCurRevisionId":73160,"wgArticleId":7982,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"zh","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgMonthNamesShort":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRelevantPageName":"c/language/conformance","wgUserVariant":"zh","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"zh","language":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-MathJax":1,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-js:7:258d7cd6aa9aa67dee25e01fb6a9e505 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-c_language_conformance skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading">遵从性</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">来自cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../c.html" title="c">c</a>‎ | <a href="../language.html" title="c/language">language</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../c.html" title="c"> C</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="../language.html" title="c/language">语言</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="c/header">头文件</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../types.html" title="c/types">类型支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../program.html" title="c/program">程序工具</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../variadic.html" title="c/variadic">变参数函数支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../memory.html" title="c/memory">动态内存管理</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../error.html" title="c/error">错误处理</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../chrono.html" title="c/chrono">日期和时间工具</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="c/string">字符串库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="c/algorithm">算法</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="c/numeric">数值</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="c/io">输入/输出支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="c/locale">本地化支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="c/thread">线程支持</a> <span class="t-mark-rev t-since-c11">(C11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../atomic.html" title="c/atomic">原子操作</a> <span class="t-mark-rev t-since-c11">(C11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="c/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../language.html" title="c/language">C 语言</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv-h2"><td colspan="5"> <a href="basic_concepts.html" title="c/language/basic concepts">基本概念</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="../keyword.html" title="c/keyword">关键词</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="../preprocessor.html" title="c/preprocessor">预处理器</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="statements.html" title="c/language/statements">语句</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="expressions.html" title="c/language/expressions">表达式</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="initialization.html" title="c/language/initialization">初始化</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="declarations.html" title="c/language/declarations">声明</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="functions.html" title="c/language/functions">函数</a></td></tr>
<tr class="t-nv"><td colspan="5"> 杂项</td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="history.html" title="c/language/history">C 的历史</a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="../experimental.html" title="c/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<p><i>遵从性 (conformance)</i> 有三重定义：
</p>
<ul><li> <i>严格遵从程序</i> - 仅使用良定义的语言构造，即拥有单一行为的构造。它不包含未指定、未定义或实现定义的行为，且不超过任何最小实现极限。
</li><li> <i>遵从程序</i> - 可为遵从实现所接受。
</li><li> <i>遵从实现</i> -
<ul><li> 遵从的有宿主实现应当接受任何严格遵从程序。
</li><li> 遵从的自立实现应当接受任何将库章（第 7 章）中指定的库特性限制到自立的标准库头文件（见后述）的内容的严格遵从程序。
</li><li> 遵从实现可拥有扩展（包括额外的库函数），只要它们不改变任何严格遵从程序的行为。
</li></ul>
</li></ul>
<h3><span class="mw-headline" id=".E8.A7.A3.E9.87.8A">解释</span></h3>
<p>标准不在翻译单元上定义任何最小实现极限。有宿主环境拥有操作系统；自立环境无操作系统。运行于有宿主环境中的程序可使用任何库章节（第 7 章）中描述的特性；运行于自立环境中的程序可使用第 4 章所要求的库特性子集。
</p>
<h4><span class="mw-headline" id=".E8.87.AA.E7.AB.8B.E7.9A.84.E6.A0.87.E5.87.86.E5.BA.93.E5.A4.B4.E6.96.87.E4.BB.B6">自立的标准库头文件</span></h4>
<p>每个完全自立的标准库头文件中的所有标准库特性均要求为自立实现所提供。
</p>
 <table class="t-rev-begin">
<tr class="t-rev t-since-c23"><td>
<p>有些头文件是条件性自立的。
</p>
<ul><li> 若实现预定义宏 <code>__STDC_IEC_60559_BFP__</code> 或 <code>__STDC_IEC_60559_BFP__</code> ，则
<ul><li> <code>&lt;math.h&gt;</code> 与 <code>&lt;fenv.h&gt;</code> 为完全自立的头文件，而
</li><li> <code>&lt;stdlib.h&gt;</code> 为部分自立的头文件。
</li></ul>
</li></ul>
<p>在部分自立的头文件中，仅一部分标准库特性要求为自立实现所提供。
</p>
<ul><li> 不要求自立实现提供 <a href="../string/byte/strdup.html" title="c/string/byte/strdup"><tt>strdup</tt></a>、 <a href="../string/byte/strndup.html" title="c/string/byte/strndup"><tt>strndup</tt></a>、 <span class="t-lc"><a href="../string/byte/strcoll.html" title="c/string/byte/strcoll">strcoll</a></span>、 <span class="t-lc"><a href="../string/byte/strxfrm.html" title="c/string/byte/strxfrm">strxfrm</a></span> 及 <span class="t-lc"><a href="../string/byte/strerror.html" title="c/string/byte/strerror">strerror</a></span> 。
</li><li> 在预定义 <code>__STDC_IEC_60559_BFP__</code> 或 <code>__STDC_IEC_60559_BFP__</code> 时，在 <code>&lt;stdlib.h&gt;</code> 中仅要求自立实现提供数值转换函数（ <code>ato<i>X</i></code>、 <code>strto<i>X</i></code> 及 <code>strfrom<i>X</i></code> ）。
</li></ul>
</td>
<td><span class="t-mark-rev t-since-c23">(C23 起)</span></td></tr>
</table>
<table class="t-dsc-begin">

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E5.AE.8C.E5.85.A8.E8.87.AA.E7.AB.8B.E7.9A.84.E6.A0.87.E5.87.86.E5.BA.93.E5.A4.B4.E6.96.87.E4.BB.B6">  完全自立的标准库头文件 </span></h5>
</td></tr>

<tr class="t-dsc">
<td> <code><b>&lt;float.h&gt;</b></code>
</td>
<td> <a href="../types/limits.html" title="c/types/limits">浮点类型的极限</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;limits.h&gt;</b></code>
</td>
<td> <a href="../types/limits.html" title="c/types/limits">整数类型的范围</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;iso646.h&gt;</b></code> <span class="t-mark-rev t-since-c95">(C95)</span>
</td>
<td> <a href="operator_alternative.html" title="c/language/operator alternative">符号的替代写法</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;stdalign.h&gt;</b></code> <span class="t-mark-rev t-since-c11">(C11)</span>
</td>
<td> <a href="../types.html" title="c/types"><code>alignas</code> 与 <code>alignof</code></a> 便利宏
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;stdarg.h&gt;</b></code>
</td>
<td> <a href="../variadic.html" title="c/variadic">可变参数</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;stdbool.h&gt;</b></code> <span class="t-mark-rev t-since-c99">(C99)</span>
</td>
<td> <a href="../types.html" title="c/types">布尔类型的宏</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;stddef.h&gt;</b></code>
</td>
<td> <a href="../types.html" title="c/types">常用宏定义</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;stdint.h&gt;</b></code> <span class="t-mark-rev t-since-c99">(C99)</span>
</td>
<td> <a href="../types/integer.html" title="c/types/integer">定宽整数类型</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;stdnoreturn.h&gt;</b></code> <span class="t-mark-rev t-since-c11">(C11)</span>
</td>
<td> <a href="../types.html" title="c/types"><tt>noreturn</tt></a> 便利宏
</td></tr>



<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E9.83.A8.E5.88.86.E8.87.AA.E7.AB.8B.E7.9A.84.E6.A0.87.E5.87.86.E5.BA.93.E5.A4.B4.E6.96.87.E4.BB.B6">  部分自立的标准库头文件 </span></h5>
</td></tr>

<tr class="t-dsc">
<td> <code><b>&lt;string.h&gt;</b></code> <span class="t-mark-rev t-since-c23">(C23)</span>
</td>
<td> <a href="../string/byte.html" title="c/string/byte">字符串处理</a>
</td></tr>



<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E6.9D.A1.E4.BB.B6.E6.80.A7.E5.AE.8C.E5.85.A8.E8.87.AA.E7.AB.8B.E7.9A.84.E6.A0.87.E5.87.86.E5.BA.93.E5.A4.B4.E6.96.87.E4.BB.B6">  条件性完全自立的标准库头文件 </span></h5>
</td></tr>

<tr class="t-dsc">
<td> <code><b>&lt;fenv.h&gt;</b></code> <span class="t-mark-rev t-since-c23">(C23)</span>
</td>
<td> <a href="../numeric/fenv.html" title="c/numeric/fenv">浮点环境</a>
</td></tr>


<tr class="t-dsc">
<td> <code><b>&lt;math.h&gt;</b></code> <span class="t-mark-rev t-since-c23">(C23)</span>
</td>
<td> <a href="../numeric/math.html" title="c/numeric/math">常用数学函数</a>
</td></tr>



<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E6.9D.A1.E4.BB.B6.E6.80.A7.E9.83.A8.E5.88.86.E8.87.AA.E7.AB.8B.E7.9A.84.E6.A0.87.E5.87.86.E5.BA.93.E5.A4.B4.E6.96.87.E4.BB.B6">  条件性部分自立的标准库头文件 </span></h5>
</td></tr>

<tr class="t-dsc">
<td> <code><b>&lt;stdlib.h&gt;</b></code> <span class="t-mark-rev t-since-c23">(C23)</span>
</td>
<td> 基础工具：<a href="../memory.html" title="c/memory">内存管理</a>、<a href="../program.html" title="c/program">程序工具</a>、<a href="../string.html" title="c/string">字符串转换</a>、<a href="../numeric/random.html" title="c/numeric/random">随机数</a>、<a href="../algorithm.html" title="c/algorithm">算法</a>
</td></tr>

</table>
<h3><span class="mw-headline" id=".E5.BC.95.E7.94.A8">引用</span></h3>
<div class="t-ref-std-17">
<ul><li> C17 标准（ISO/IEC 9899:2018）：
</li></ul>
<dl><dd><ul><li> 4 Conformance (p: 4)
</li></ul>
</dd></dl>
</div>
<div class="t-ref-std-11">
<ul><li> C11 标准（ISO/IEC 9899:2011）：
</li></ul>
<dl><dd><ul><li> 4 Conformance (p: 8-9)
</li></ul>
</dd></dl>
</div>
<div class="t-ref-std-c99">
<ul><li> C99 标准（ISO/IEC 9899:1999）：
</li></ul>
<dl><dd><ul><li> 4 Conformance (p: 7-8)
</li></ul>
</dd></dl>
</div>
<div class="t-ref-std-c89">
<ul><li> C89/C90 标准（ISO/IEC 9899:1990）： 
</li></ul>
<dl><dd><ul><li> 1.7 Compliance 
</li></ul>
</dd></dl>
</div>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
<table class="t-dsc-begin">

</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 1207/1000000
Preprocessor generated node count: 4326/1000000
Post‐expand include size: 28729/2097152 bytes
Template argument size: 6649/2097152 bytes
Highest expansion depth: 13/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_zh_:pcache:idhash:7982-0!*!0!!zh!*!zh!* and timestamp 20211208102901 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    来自“<a href="https://zh.cppreference.com/mwiki/index.php?title=c/language/conformance&amp;oldid=73160">https://zh.cppreference.com/mwiki/index.php?title=c/language/conformance&amp;oldid=73160</a>”                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>导航</h5>
            <ul><li><a href="https://zh.cppreference.com/w/c/language/conformance">Online version</a></li><li>Offline version retrieved 2022-01-01 00:37.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> 本页面最后修改于2021年12月8日 (星期三) 02:29。</li>
                                    <li id="footer-info-viewcount">此页面已被浏览过3,163次。</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.MathJax","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 0.084 secs. -->
	</body>
<!-- Cached 20211208193240 -->
</html>